project(platform_zncz)

#version
execute_process(COMMAND git describe --always --tags
                OUTPUT_VARIABLE GIT_BRANCH_ORIGIN)
if("x" STREQUAL "x${GIT_BRANCH_ORIGIN}")
  set(GIT_BRANCH_ORIGIN "v0.0-0-g0000000")
endif()
string(STRIP ${GIT_BRANCH_ORIGIN} GIT_BRANCH)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
               ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)

               
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
     "${CMAKE_CURRENT_SOURCE_DIR}/**.cpp")

add_executable(${PROJECT_NAME} ${sources})
target_link_libraries(${PROJECT_NAME} PUBLIC hv sqlite3)
# 包含头文件少去了"hv/"前缀
target_include_directories(${PROJECT_NAME} PUBLIC 
    ${libhv_BINARY_DIR}/include/hv
    ${CMAKE_CURRENT_SOURCE_DIR}/
    ${CMAKE_CURRENT_BINARY_DIR}
)
     